package test_package;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15.11.13
 * Time: 14:54
 * To change this template use File | Settings | File Templates.
 */
public class buxfer_com_incorrect_login {
    WebDriver driver = new FirefoxDriver();

    @Test
    public void buxfer_com_incorrect_password () {
        driver.get("https://www.buxfer.com");
        driver.findElement(By.id("login_username")).sendKeys("destinygenerated@gmail.com");
        driver.findElement(By.id("login_password")).sendKeys("456456");
        driver.findElement(By.xpath("//a[contains(text(),'Login')]")).click();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.findElement(By.tagName("body"));
        Assert.assertTrue(driver.getCurrentUrl().contentEquals("https://www.buxfer.com/slogin"));
        Assert.assertTrue(driver.findElement(By.id("login_errordiv")).getText().contains("incorrect password"));

    }

    @AfterTest
    public void buxter_quit () {
        driver.quit();
    }
}
